home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / libg_261.zip / libg_261 / libg++ / libg++.info-1 (.txt) < prev    next >
GNU Info File  |  1994-10-24  |  41KB  |  667 lines

  1. This is Info file libg++.info, produced by Makeinfo-1.55 from the input
  2. file ./libg++.texi.
  3. START-INFO-DIR-ENTRY
  4. * Libg++: (libg++).             The g++ class library.
  5. END-INFO-DIR-ENTRY
  6.    This file documents the features and implementation of The GNU C++
  7. library
  8.    Copyright (C) 1988, 1991, 1992 Free Software Foundation, Inc.
  9.    Permission is granted to make and distribute verbatim copies of this
  10. manual provided the copyright notice and this permission notice are
  11. preserved on all copies.
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided also
  14. that the section entitled "GNU Library General Public License" is
  15. included exactly as in the original, and provided that the entire
  16. resulting derived work is distributed under the terms of a permission
  17. notice identical to this one.
  18.    Permission is granted to copy and distribute translations of this
  19. manual into another language, under the above conditions for modified
  20. versions, except that the section entitled "GNU Library General Public
  21. License" and this permission notice may be included in translations
  22. approved by the Free Software Foundation instead of in the original
  23. English.
  24. File: libg++.info,  Node: Top,  Next: Copying,  Up: (DIR)
  25.    Introduction ************
  26.    This manual documents how to install and use the GNU C++ library.
  27. * Menu:
  28. * Copying::        GNU Library Public License says how you can copy
  29.                     and share the GNU C++ library.
  30. * Contributors::    People who have contributed to GNU C++ library.
  31. * Installation::    How to configure, compile and install GNU C++ library
  32. * Trouble::         If you have trouble installing GNU C++ library.
  33. * General::         Aims, objectives, and limitations of the GNU C++ library
  34. * Conventions::     Stylistic conventions
  35. * OK::              Support for representation invariants
  36. * Proto::           Introduction to container class prototypes
  37. * Pix::             Pseudo-indexes
  38. * Representations:: How variable-sized objects are represented
  39. * Expressions::     Some guidance on programming expression-oriented classes
  40. * Headers::         Header files and other support for interfacing C++ to C
  41. * Builtin::         Utility functions for builtin types
  42. * New::             Library dynamic allocation primitives
  43. * IOStream:(iostream)Top.
  44.                     The input/output library (istreams and ostreams).
  45. * Stream::          obsolete I/O library
  46. * Obstack::         Obstacks and their uses.
  47. * AllocRing::       A place to store objects for a while
  48. * String::          String, SubString, and Regex classes.
  49. * Integer::         Multiple precision Integer class.
  50. * Rational::        Multiple precision Rational class
  51. * Complex::         Complex number class
  52. * Fix::             Fixed point proportion classes
  53. * Bit::             BitSet and BitString classes
  54. * Random::          Random number generators
  55. * Data::            SampleStatistic and related classes for data collection
  56. * Curses::          CursesWindow class
  57. * List::            Lisp-like List prototype
  58. * LinkList::        Singly and doubly linked list class prototypes
  59. * Vector::          Vector prototypes
  60. * Plex::            Plex (adjustable array) prototypes
  61. * Stack::           Stack prototypes
  62. * Queue::           Queue prototypes
  63. * Deque::           Double ended queue prototypes
  64. * PQ::              Heap (priority queue) class prototypes
  65. * Set::             Set class prototypes
  66. * Bag::             Bag class prototypes
  67. * Map::             Map (Associative array) prototypes
  68. * GetOpt::          C++ class-based version of the GNU/UNIX getopt function
  69. * Projects::        Things Still Left to do
  70. File: libg++.info,  Node: Copying,  Next: Contributors,  Prev: Top,  Up: Top
  71. GNU LIBRARY GENERAL PUBLIC LICENSE
  72. **********************************
  73.                          Version 2, June 1991
  74.      Copyright (C) 1991 Free Software Foundation, Inc.
  75.      675 Mass Ave, Cambridge, MA 02139, USA
  76.      Everyone is permitted to copy and distribute verbatim copies
  77.      of this license document, but changing it is not allowed.
  78.      
  79.      [This is the first released version of the library GPL.  It is
  80.       numbered 2 because it goes with version 2 of the ordinary GPL.]
  81. Preamble
  82. ========
  83.    The licenses for most software are designed to take away your
  84. freedom to share and change it.  By contrast, the GNU General Public
  85. Licenses are intended to guarantee your freedom to share and change
  86. free software--to make sure the software is free for all its users.
  87.    This license, the Library General Public License, applies to some
  88. specially designated Free Software Foundation software, and to any
  89. other libraries whose authors decide to use it.  You can use it for
  90. your libraries, too.
  91.    When we speak of free software, we are referring to freedom, not
  92. price.  Our General Public Licenses are designed to make sure that you
  93. have the freedom to distribute copies of free software (and charge for
  94. this service if you wish), that you receive source code or can get it
  95. if you want it, that you can change the software or use pieces of it in
  96. new free programs; and that you know you can do these things.
  97.    To protect your rights, we need to make restrictions that forbid
  98. anyone to deny you these rights or to ask you to surrender the rights.
  99. These restrictions translate to certain responsibilities for you if you
  100. distribute copies of the library, or if you modify it.
  101.    For example, if you distribute copies of the library, whether gratis
  102. or for a fee, you must give the recipients all the rights that we gave
  103. you.  You must make sure that they, too, receive or can get the source
  104. code.  If you link a program with the library, you must provide
  105. complete object files to the recipients so that they can relink them
  106. with the library, after making changes to the library and recompiling
  107. it.  And you must show them these terms so they know their rights.
  108.    Our method of protecting your rights has two steps: (1) copyright
  109. the library, and (2) offer you this license which gives you legal
  110. permission to copy, distribute and/or modify the library.
  111.    Also, for each distributor's protection, we want to make certain
  112. that everyone understands that there is no warranty for this free
  113. library.  If the library is modified by someone else and passed on, we
  114. want its recipients to know that what they have is not the original
  115. version, so that any problems introduced by others will not reflect on
  116. the original authors' reputations.
  117.    Finally, any free program is threatened constantly by software
  118. patents.  We wish to avoid the danger that companies distributing free
  119. software will individually obtain patent licenses, thus in effect
  120. transforming the program into proprietary software.  To prevent this,
  121. we have made it clear that any patent must be licensed for everyone's
  122. free use or not licensed at all.
  123.    Most GNU software, including some libraries, is covered by the
  124. ordinary GNU General Public License, which was designed for utility
  125. programs.  This license, the GNU Library General Public License,
  126. applies to certain designated libraries.  This license is quite
  127. different from the ordinary one; be sure to read it in full, and don't
  128. assume that anything in it is the same as in the ordinary license.
  129.    The reason we have a separate public license for some libraries is
  130. that they blur the distinction we usually make between modifying or
  131. adding to a program and simply using it.  Linking a program with a
  132. library, without changing the library, is in some sense simply using
  133. the library, and is analogous to running a utility program or
  134. application program.  However, in a textual and legal sense, the linked
  135. executable is a combined work, a derivative of the original library,
  136. and the ordinary General Public License treats it as such.
  137.    Because of this blurred distinction, using the ordinary General
  138. Public License for libraries did not effectively promote software
  139. sharing, because most developers did not use the libraries.  We
  140. concluded that weaker conditions might promote sharing better.
  141.    However, unrestricted linking of non-free programs would deprive the
  142. users of those programs of all benefit from the free status of the
  143. libraries themselves.  This Library General Public License is intended
  144. to permit developers of non-free programs to use free libraries, while
  145. preserving your freedom as a user of such programs to change the free
  146. libraries that are incorporated in them.  (We have not seen how to
  147. achieve this as regards changes in header files, but we have achieved
  148. it as regards changes in the actual functions of the Library.)  The
  149. hope is that this will lead to faster development of free libraries.
  150.    The precise terms and conditions for copying, distribution and
  151. modification follow.  Pay close attention to the difference between a
  152. "work based on the library" and a "work that uses the library".  The
  153. former contains code derived from the library, while the latter only
  154. works together with the library.
  155.    Note that it is possible for a library to be covered by the ordinary
  156. General Public License rather than by this special one.
  157.     TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  158.   0. This License Agreement applies to any software library which
  159.      contains a notice placed by the copyright holder or other
  160.      authorized party saying it may be distributed under the terms of
  161.      this Library General Public License (also called "this License").
  162.      Each licensee is addressed as "you".
  163.      A "library" means a collection of software functions and/or data
  164.      prepared so as to be conveniently linked with application programs
  165.      (which use some of those functions and data) to form executables.
  166.      The "Library", below, refers to any such software library or work
  167.      which has been distributed under these terms.  A "work based on the
  168.      Library" means either the Library or any derivative work under
  169.      copyright law: that is to say, a work containing the Library or a
  170.      portion of it, either verbatim or with modifications and/or
  171.      translated straightforwardly into another language.  (Hereinafter,
  172.      translation is included without limitation in the term
  173.      "modification".)
  174.      "Source code" for a work means the preferred form of the work for
  175.      making modifications to it.  For a library, complete source code
  176.      means all the source code for all modules it contains, plus any
  177.      associated interface definition files, plus the scripts used to
  178.      control compilation and installation of the library.
  179.      Activities other than copying, distribution and modification are
  180.      not covered by this License; they are outside its scope.  The act
  181.      of running a program using the Library is not restricted, and
  182.      output from such a program is covered only if its contents
  183.      constitute a work based on the Library (independent of the use of
  184.      the Library in a tool for writing it).  Whether that is true
  185.      depends on what the Library does and what the program that uses
  186.      the Library does.
  187.   1. You may copy and distribute verbatim copies of the Library's
  188.      complete source code as you receive it, in any medium, provided
  189.      that you conspicuously and appropriately publish on each copy an
  190.      appropriate copyright notice and disclaimer of warranty; keep
  191.      intact all the notices that refer to this License and to the
  192.      absence of any warranty; and distribute a copy of this License
  193.      along with the Library.
  194.      You may charge a fee for the physical act of transferring a copy,
  195.      and you may at your option offer warranty protection in exchange
  196.      for a fee.
  197.   2. You may modify your copy or copies of the Library or any portion
  198.      of it, thus forming a work based on the Library, and copy and
  199.      distribute such modifications or work under the terms of Section 1
  200.      above, provided that you also meet all of these conditions:
  201.        a. The modified work must itself be a software library.
  202.        b. You must cause the files modified to carry prominent notices
  203.           stating that you changed the files and the date of any change.
  204.        c. You must cause the whole of the work to be licensed at no
  205.           charge to all third parties under the terms of this License.
  206.        d. If a facility in the modified Library refers to a function or
  207.           a table of data to be supplied by an application program that
  208.           uses the facility, other than as an argument passed when the
  209.           facility is invoked, then you must make a good faith effort
  210.           to ensure that, in the event an application does not supply
  211.           such function or table, the facility still operates, and
  212.           performs whatever part of its purpose remains meaningful.
  213.           (For example, a function in a library to compute square roots
  214.           has a purpose that is entirely well-defined independent of the
  215.           application.  Therefore, Subsection 2d requires that any
  216.           application-supplied function or table used by this function
  217.           must be optional: if the application does not supply it, the
  218.           square root function must still compute square roots.)
  219.      These requirements apply to the modified work as a whole.  If
  220.      identifiable sections of that work are not derived from the
  221.      Library, and can be reasonably considered independent and separate
  222.      works in themselves, then this License, and its terms, do not
  223.      apply to those sections when you distribute them as separate
  224.      works.  But when you distribute the same sections as part of a
  225.      whole which is a work based on the Library, the distribution of
  226.      the whole must be on the terms of this License, whose permissions
  227.      for other licensees extend to the entire whole, and thus to each
  228.      and every part regardless of who wrote it.
  229.      Thus, it is not the intent of this section to claim rights or
  230.      contest your rights to work written entirely by you; rather, the
  231.      intent is to exercise the right to control the distribution of
  232.      derivative or collective works based on the Library.
  233.      In addition, mere aggregation of another work not based on the
  234.      Library with the Library (or with a work based on the Library) on
  235.      a volume of a storage or distribution medium does not bring the
  236.      other work under the scope of this License.
  237.   3. You may opt to apply the terms of the ordinary GNU General Public
  238.      License instead of this License to a given copy of the Library.
  239.      To do this, you must alter all the notices that refer to this
  240.      License, so that they refer to the ordinary GNU General Public
  241.      License, version 2, instead of to this License.  (If a newer
  242.      version than version 2 of the ordinary GNU General Public License
  243.      has appeared, then you can specify that version instead if you
  244.      wish.)  Do not make any other change in these notices.
  245.      Once this change is made in a given copy, it is irreversible for
  246.      that copy, so the ordinary GNU General Public License applies to
  247.      all subsequent copies and derivative works made from that copy.
  248.      This option is useful when you wish to copy part of the code of
  249.      the Library into a program that is not a library.
  250.   4. You may copy and distribute the Library (or a portion or
  251.      derivative of it, under Section 2) in object code or executable
  252.      form under the terms of Sections 1 and 2 above provided that you
  253.      accompany it with the complete corresponding machine-readable
  254.      source code, which must be distributed under the terms of Sections
  255.      1 and 2 above on a medium customarily used for software
  256.      interchange.
  257.      If distribution of object code is made by offering access to copy
  258.      from a designated place, then offering equivalent access to copy
  259.      the source code from the same place satisfies the requirement to
  260.      distribute the source code, even though third parties are not
  261.      compelled to copy the source along with the object code.
  262.   5. A program that contains no derivative of any portion of the
  263.      Library, but is designed to work with the Library by being
  264.      compiled or linked with it, is called a "work that uses the
  265.      Library".  Such a work, in isolation, is not a derivative work of
  266.      the Library, and therefore falls outside the scope of this License.
  267.      However, linking a "work that uses the Library" with the Library
  268.      creates an executable that is a derivative of the Library (because
  269.      it contains portions of the Library), rather than a "work that
  270.      uses the library".  The executable is therefore covered by this
  271.      License.  Section 6 states terms for distribution of such
  272.      executables.
  273.      When a "work that uses the Library" uses material from a header
  274.      file that is part of the Library, the object code for the work may
  275.      be a derivative work of the Library even though the source code is
  276.      not.  Whether this is true is especially significant if the work
  277.      can be linked without the Library, or if the work is itself a
  278.      library.  The threshold for this to be true is not precisely
  279.      defined by law.
  280.      If such an object file uses only numerical parameters, data
  281.      structure layouts and accessors, and small macros and small inline
  282.      functions (ten lines or less in length), then the use of the object
  283.      file is unrestricted, regardless of whether it is legally a
  284.      derivative work.  (Executables containing this object code plus
  285.      portions of the Library will still fall under Section 6.)
  286.      Otherwise, if the work is a derivative of the Library, you may
  287.      distribute the object code for the work under the terms of Section
  288.      6.  Any executables containing that work also fall under Section 6,
  289.      whether or not they are linked directly with the Library itself.
  290.   6. As an exception to the Sections above, you may also compile or
  291.      link a "work that uses the Library" with the Library to produce a
  292.      work containing portions of the Library, and distribute that work
  293.      under terms of your choice, provided that the terms permit
  294.      modification of the work for the customer's own use and reverse
  295.      engineering for debugging such modifications.
  296.      You must give prominent notice with each copy of the work that the
  297.      Library is used in it and that the Library and its use are covered
  298.      by this License.  You must supply a copy of this License.  If the
  299.      work during execution displays copyright notices, you must include
  300.      the copyright notice for the Library among them, as well as a
  301.      reference directing the user to the copy of this License.  Also,
  302.      you must do one of these things:
  303.        a. Accompany the work with the complete corresponding
  304.           machine-readable source code for the Library including
  305.           whatever changes were used in the work (which must be
  306.           distributed under Sections 1 and 2 above); and, if the work
  307.           is an executable linked with the Library, with the complete
  308.           machine-readable "work that uses the Library", as object code
  309.           and/or source code, so that the user can modify the Library
  310.           and then relink to produce a modified executable containing
  311.           the modified Library.  (It is understood that the user who
  312.           changes the contents of definitions files in the Library will
  313.           not necessarily be able to recompile the application to use
  314.           the modified definitions.)
  315.        b. Accompany the work with a written offer, valid for at least
  316.           three years, to give the same user the materials specified in
  317.           Subsection 6a, above, for a charge no more than the cost of
  318.           performing this distribution.
  319.        c. If distribution of the work is made by offering access to copy
  320.           from a designated place, offer equivalent access to copy the
  321.           above specified materials from the same place.
  322.        d. Verify that the user has already received a copy of these
  323.           materials or that you have already sent this user a copy.
  324.      For an executable, the required form of the "work that uses the
  325.      Library" must include any data and utility programs needed for
  326.      reproducing the executable from it.  However, as a special
  327.      exception, the source code distributed need not include anything
  328.      that is normally distributed (in either source or binary form)
  329.      with the major components (compiler, kernel, and so on) of the
  330.      operating system on which the executable runs, unless that
  331.      component itself accompanies the executable.
  332.      It may happen that this requirement contradicts the license
  333.      restrictions of other proprietary libraries that do not normally
  334.      accompany the operating system.  Such a contradiction means you
  335.      cannot use both them and the Library together in an executable
  336.      that you distribute.
  337.   7. You may place library facilities that are a work based on the
  338.      Library side-by-side in a single library together with other
  339.      library facilities not covered by this License, and distribute
  340.      such a combined library, provided that the separate distribution
  341.      of the work based on the Library and of the other library
  342.      facilities is otherwise permitted, and provided that you do these
  343.      two things:
  344.        a. Accompany the combined library with a copy of the same work
  345.           based on the Library, uncombined with any other library
  346.           facilities.  This must be distributed under the terms of the
  347.           Sections above.
  348.        b. Give prominent notice with the combined library of the fact
  349.           that part of it is a work based on the Library, and explaining
  350.           where to find the accompanying uncombined form of the same
  351.           work.
  352.   8. You may not copy, modify, sublicense, link with, or distribute the
  353.      Library except as expressly provided under this License.  Any
  354.      attempt otherwise to copy, modify, sublicense, link with, or
  355.      distribute the Library is void, and will automatically terminate
  356.      your rights under this License.  However, parties who have
  357.      received copies, or rights, from you under this License will not
  358.      have their licenses terminated so long as such parties remain in
  359.      full compliance.
  360.   9. You are not required to accept this License, since you have not
  361.      signed it.  However, nothing else grants you permission to modify
  362.      or distribute the Library or its derivative works.  These actions
  363.      are prohibited by law if you do not accept this License.
  364.      Therefore, by modifying or distributing the Library (or any work
  365.      based on the Library), you indicate your acceptance of this
  366.      License to do so, and all its terms and conditions for copying,
  367.      distributing or modifying the Library or works based on it.
  368.  10. Each time you redistribute the Library (or any work based on the
  369.      Library), the recipient automatically receives a license from the
  370.      original licensor to copy, distribute, link with or modify the
  371.      Library subject to these terms and conditions.  You may not impose
  372.      any further restrictions on the recipients' exercise of the rights
  373.      granted herein.  You are not responsible for enforcing compliance
  374.      by third parties to this License.
  375.  11. If, as a consequence of a court judgment or allegation of patent
  376.      infringement or for any other reason (not limited to patent
  377.      issues), conditions are imposed on you (whether by court order,
  378.      agreement or otherwise) that contradict the conditions of this
  379.      License, they do not excuse you from the conditions of this
  380.      License.  If you cannot distribute so as to satisfy simultaneously
  381.      your obligations under this License and any other pertinent
  382.      obligations, then as a consequence you may not distribute the
  383.      Library at all.  For example, if a patent license would not permit
  384.      royalty-free redistribution of the Library by all those who
  385.      receive copies directly or indirectly through you, then the only
  386.      way you could satisfy both it and this License would be to refrain
  387.      entirely from distribution of the Library.
  388.      If any portion of this section is held invalid or unenforceable
  389.      under any particular circumstance, the balance of the section is
  390.      intended to apply, and the section as a whole is intended to apply
  391.      in other circumstances.
  392.      It is not the purpose of this section to induce you to infringe any
  393.      patents or other property right claims or to contest validity of
  394.      any such claims; this section has the sole purpose of protecting
  395.      the integrity of the free software distribution system which is
  396.      implemented by public license practices.  Many people have made
  397.      generous contributions to the wide range of software distributed
  398.      through that system in reliance on consistent application of that
  399.      system; it is up to the author/donor to decide if he or she is
  400.      willing to distribute software through any other system and a
  401.      licensee cannot impose that choice.
  402.      This section is intended to make thoroughly clear what is believed
  403.      to be a consequence of the rest of this License.
  404.  12. If the distribution and/or use of the Library is restricted in
  405.      certain countries either by patents or by copyrighted interfaces,
  406.      the original copyright holder who places the Library under this
  407.      License may add an explicit geographical distribution limitation
  408.      excluding those countries, so that distribution is permitted only
  409.      in or among countries not thus excluded.  In such case, this
  410.      License incorporates the limitation as if written in the body of
  411.      this License.
  412.  13. The Free Software Foundation may publish revised and/or new
  413.      versions of the Library General Public License from time to time.
  414.      Such new versions will be similar in spirit to the present version,
  415.      but may differ in detail to address new problems or concerns.
  416.      Each version is given a distinguishing version number.  If the
  417.      Library specifies a version number of this License which applies
  418.      to it and "any later version", you have the option of following
  419.      the terms and conditions either of that version or of any later
  420.      version published by the Free Software Foundation.  If the Library
  421.      does not specify a license version number, you may choose any
  422.      version ever published by the Free Software Foundation.
  423.  14. If you wish to incorporate parts of the Library into other free
  424.      programs whose distribution conditions are incompatible with these,
  425.      write to the author to ask for permission.  For software which is
  426.      copyrighted by the Free Software Foundation, write to the Free
  427.      Software Foundation; we sometimes make exceptions for this.  Our
  428.      decision will be guided by the two goals of preserving the free
  429.      status of all derivatives of our free software and of promoting
  430.      the sharing and reuse of software generally.
  431.                                 NO WARRANTY
  432.  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
  433.      WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE
  434.      LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
  435.      HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT
  436.      WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
  437.      NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  438.      FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE
  439.      QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU.  SHOULD THE
  440.      LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
  441.      SERVICING, REPAIR OR CORRECTION.
  442.  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
  443.      WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
  444.      MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE
  445.      LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
  446.      INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
  447.      INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF
  448.      DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
  449.      OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY
  450.      OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
  451.      ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  452.                       END OF TERMS AND CONDITIONS
  453. How to Apply These Terms to Your New Libraries
  454. ==============================================
  455.    If you develop a new library, and you want it to be of the greatest
  456. possible use to the public, we recommend making it free software that
  457. everyone can redistribute and change.  You can do so by permitting
  458. redistribution under these terms (or, alternatively, under the terms of
  459. the ordinary General Public License).
  460.    To apply these terms, attach the following notices to the library.
  461. It is safest to attach them to the start of each source file to most
  462. effectively convey the exclusion of warranty; and each file should have
  463. at least the "copyright" line and a pointer to where the full notice is
  464. found.
  465.      ONE LINE TO GIVE THE LIBRARY'S NAME AND AN IDEA OF WHAT IT DOES.
  466.      Copyright (C) YEAR  NAME OF AUTHOR
  467.      
  468.      This library is free software; you can redistribute it and/or
  469.      modify it under the terms of the GNU Library General Public
  470.      License as published by the Free Software Foundation; either
  471.      version 2 of the License, or (at your option) any later version.
  472.      
  473.      This library is distributed in the hope that it will be useful,
  474.      but WITHOUT ANY WARRANTY; without even the implied warranty of
  475.      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  476.      Library General Public License for more details.
  477.      
  478.      You should have received a copy of the GNU Library General Public
  479.      License along with this library; if not, write to the
  480.      Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
  481.      MA 02139, USA.
  482.    Also add information on how to contact you by electronic and paper
  483. mail.
  484.    You should also get your employer (if you work as a programmer) or
  485. your school, if any, to sign a "copyright disclaimer" for the library,
  486. if necessary.  Here is a sample; alter the names:
  487.      Yoyodyne, Inc., hereby disclaims all copyright interest in
  488.      the library `Frob' (a library for tweaking knobs) written
  489.      by James Random Hacker.
  490.      
  491.      SIGNATURE OF TY COON, 1 April 1990
  492.      Ty Coon, President of Vice
  493.    That's all there is to it!
  494. File: libg++.info,  Node: Contributors,  Next: Installation,  Prev: Copying,  Up: Top
  495. Contributors to GNU C++ library
  496. *******************************
  497.    Aside from Michael Tiemann, who worked out the front end for GNU
  498. C++, and Richard Stallman, who worked out the back end, the following
  499. people (not including those who have made their contributions to GNU
  500. CC) should not go unmentioned.
  501.    * Doug Lea contributed most otherwise unattributed classes.
  502.    * Per Bothner contributed the iostream I/O classes.
  503.    * Dirk Grunwald contributed the Random number generation classes,
  504.      and PairingHeaps.
  505.    * Kurt Baudendistel contributed Fixed precision reals.
  506.    * Doug Schmidt contributed ordered hash tables, a perfect hash
  507.      function generator, and several other utilities.
  508.    * Marc Shapiro contributed the ideas and preliminary code for Plexes.
  509.    * Eric Newton contributed the curses window classes.
  510.    * Some of the I/O code is derived from BSD 4.4, and was developed by
  511.      the University of California, Berkeley.
  512.    * The code for converting accurately between floating point numbers
  513.      and their string representations was written by David M. Gay of
  514.      AT&T.
  515. File: libg++.info,  Node: Installation,  Next: Trouble,  Prev: Contributors,  Up: Top
  516. Installing GNU C++ library
  517. **************************
  518.   1. Read through the README file and the Makefile. Make sure that all
  519.      paths, system-dependent compile switches, and program names are
  520.      correct.
  521.   2. Check that files  `values.h', `stdio.h', and `math.h' declare and
  522.      define values appropriate for your system.
  523.   3. Type `make all' to compile the library, test, and install.
  524.      Current details about contents of the tests and utilities are in
  525.      the `README' file.
  526. File: libg++.info,  Node: Trouble,  Next: General,  Prev: Installation,  Up: Top
  527. Trouble in Installation
  528. ***********************
  529.    Here are some of the things that have caused trouble for people
  530. installing GNU C++ library.
  531.   1. Make sure that your GNU C++ version number is at least as high as
  532.      your libg++ version number. For example, libg++ 1.22.0 requires
  533.      g++ 1.22.0 or later releases.
  534.   2. Double-check system constants in the header files mentioned above.
  535. File: libg++.info,  Node: General,  Next: Conventions,  Prev: Trouble,  Up: Top
  536. GNU C++ library aims, objectives, and limitations
  537. *************************************************
  538.    The GNU C++ library, libg++ is an attempt to provide a variety of C++
  539. programming tools and other support to GNU C++ programmers.
  540.    Differences in distribution policy are only part of the difference
  541. between libg++.a and AT&T libC.a.  libg++ is not intended to be an
  542. exact clone of libC. For one, libg++ contains bits of code that depend
  543. on special features of GNU g++ that are either different or lacking in
  544. the AT&T version, including slightly different inlining and overloading
  545. strategies, dynamic local arrays, etc.  All of these differences are
  546. minor. For example, while the AT&T and GNU stream classes are
  547. implemented in very different ways, the vast majority of C++ programs
  548. compile and run under either version with no visible difference.
  549. Additionally, all g++-specific constructs are conditionally compiled;
  550. The library is designed to be compatible with any 2.0 C++ compiler.
  551.    libg++ has also contained workarounds for some limitations in g++:
  552. both g++ and libg++ are still undergoing rapid development and
  553. testing--a task that is helped tremendously by the feedback of active
  554. users.  This manual is also still under development; it has some
  555. catching up to do to include all the facilities now in the library.
  556.    libg++ is not the only freely available source of C++ class
  557. libraries.  Some notable alternative sources are Interviews and NIHCL.
  558. (InterViews has been available on the X-windows X11 tapes and also from
  559. interviews.stanford.edu.  NIHCL is available by anonymous ftp from GNU
  560. archives (such as the pub directory of prep.ai.mit.edu), although it is
  561. not supported by the FSF - and needs some work before it will work with
  562. g++.)
  563.    As every C++ programmer knows, the design (moreso than the
  564. implementation) of a C++ class library is something of a challenge.
  565. Part of the reason is that C++ supports two, partially incompatible,
  566. styles of object-oriented programming - The "forest" approach,
  567. involving a collection of free-standing classes that can be mixed and
  568. matched, versus the completely hierarchical (smalltalk style) approach,
  569. in which all classes are derived from a common ancestor.  Of course,
  570. both styles have advantages and disadvantages.  So far, libg++ has
  571. adopted the "forest" approach.  Keith Gorlen's OOPS library adopts the
  572. hierarchical approach, and may be an attractive alternative for C++
  573. programmers who prefer this style.
  574.    Currently (and/or in the near future) libg++ provides support for a
  575. few basic kinds of classes:
  576.    The first kind of support provides an interface between C++ programs
  577. and C libraries. This includes basic header files (like `stdio.h') as
  578. well as things like the File and stream classes. Other classes that
  579. interface to other aspects of C libraries (like those that maintain
  580. environmental information) are in various stages of development; all
  581. will undergo implementation modifications when the forthcoming GNU libc
  582. library is released.
  583.    The second kind of support contains general-purpose basic classes
  584. that transparently manage variable-sized objects on the freestore.  This
  585. includes Obstacks, multiple-precision Integers and Rationals, arbitrary
  586. length Strings, BitSets, and BitStrings.
  587.    Third, several classes and utilities of common interest (e.g.,
  588. Complex numbers) are provided.
  589.    Fourth, a set of pseudo-generic prototype files are available as a
  590. mechanism for generating common container classes. These are described
  591. in more detail in the introduction to container prototypes. Currently,
  592. only a textual substitution mechanism is available for generic class
  593. creation.
  594. File: libg++.info,  Node: Conventions,  Next: OK,  Prev: General,  Up: Top
  595. GNU C++ library stylistic conventions
  596. *************************************
  597.    * C++ source files have file extension `.cc'. Both C-compatibility
  598.      header files and class declaration files have extension `.h'.
  599.    * C++ class names begin with capital letters, except for `istream'
  600.      and `ostream', for AT&T C++ compatibility. Multi-word class names
  601.      capitalize each word, with no underscore separation.
  602.    * Include files that define C++ classes begin with capital letters
  603.      (as do the names of the classes themselves).  `stream.h' is
  604.      uncapitalized for AT&T C++ compatibility.
  605.    * Include files that supply function prototypes for other C
  606.      functions (system calls and libraries) are all lower case.
  607.    * All include files define a preprocessor variable _X_h, where X is
  608.      the name of the file, and conditionally compile only if this has
  609.      not been already defined. The `#pragma once' facility is also used
  610.      to avoid re-inclusion.
  611.    * Structures and objects that must be publicly defined, but are not
  612.      intended for public use have names beginning with an underscore.
  613.      (for example, the `_Srep' struct, which is used only by the String
  614.      and SubString classes.)
  615.    * The underscore is used to separate components of long function
  616.      names,
  617.      e.g., `set_File_exception_handler()'.
  618.    * When a function could be usefully defined either as a member or a
  619.      friend, it is generally a member if it modifies and/or returns
  620.      itself, else it is a friend. There are cases where naturalness of
  621.      expression wins out over this rule.
  622.    * Class declaration files are formatted so that it is easy to
  623.      quickly check them to determine function names, parameters, and so
  624.      on. Because of the different kinds of things that may appear in
  625.      class declarations, there is no perfect way to do this. Any
  626.      suggestions on developing a common class declaration formatting
  627.      style are welcome.
  628.    * All classes use the same simple error (exception) handling
  629.      strategy.  Almost every class has a member function named
  630.      `error(char* msg)' that invokes an associated error handler
  631.      function via a pointer to that function, so that the error
  632.      handling function may be reset by programmers. By default nearly
  633.      all call `*lib_error_handler', which prints the message and then
  634.      aborts execution. This system is subject to change. In general,
  635.      errors are assumed to be non-recoverable: Library classes do not
  636.      include code that allows graceful continuation after exceptions.
  637. File: libg++.info,  Node: OK,  Next: Proto,  Prev: Conventions,  Up: Top
  638. Support for representation invariants
  639. *************************************
  640.    Most GNU C++ library classes possess a method named `OK()', that is
  641. useful in helping to verify correct performance of class operations.
  642.    The `OK()' operations checks the "representation invariant" of a
  643. class object. This is a test to check whether the object is in a valid
  644. state. In effect, it is a (sometimes partial) verification of the
  645. library's promise that (1) class operations always leave objects in
  646. valid states, and (2) the class protects itself so that client functions
  647. cannot corrupt this state.
  648.    While no simple validation technique can assure that all operations
  649. perform correctly, calls to `OK()' can at least verify that operations
  650. do not corrupt representations. For example for `String a, b, c; ... a
  651. = b + c;', a call to `a.OK();' will guarantee that `a' is a valid
  652. `String', but does not guarantee that it contains the concatenation of
  653. `b + c'. However, given that `a' is known to be valid, it is possible
  654. to further verify its properties, for example via `a.after(b) == c &&
  655. a.before(c) == b'. In other words, `OK()' generally checks only those
  656. internal representation properties that are otherwise inaccessible to
  657. users of the class. Other class operations are often useful for further
  658. validation.
  659.    Failed calls to `OK()' call a class's `error' method if one exists,
  660. else directly call `abort'. Failure indicates an implementation error
  661. that should be reported.
  662.    With only rare exceptions, the internal support functions for a class
  663. never themselves call `OK()' (although many of the test files in the
  664. distribution call `OK()' extensively).
  665.    Verification of representational invariants can sometimes be very
  666. time consuming for complicated data structures.
  667.